package com.hangil.aimthehole;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.RelativeLayout;

public class MainActivity extends Activity {
	
	private static final String TAG = "MAIN_ACTIVITY";
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        
        RelativeLayout rootView = (RelativeLayout)findViewById(R.id.rootView);
        rootView.setOnTouchListener(new OnTouchListener() 
        {
			public boolean onTouch(View v, MotionEvent event) 
			{
				getTouchInformation(event,event.getAction());
				switch (event.getAction()) 
				{
				case MotionEvent.ACTION_DOWN:
					Log.i(TAG, "DOWN");
					break;

				case MotionEvent.ACTION_UP:
					Log.i(TAG, "UP");
					break;
					
				case MotionEvent.ACTION_MOVE:
					Log.i(TAG, "MOVE");
					break;

				case MotionEvent.ACTION_OUTSIDE:
					Log.i(TAG, "OUTSIDE");
					break;

				default:
					break;
				}
				return false;
			}
		});
    }
    
    
    private void getTouchInformation(MotionEvent motion, int action)
    {
    	Log.i(TAG,"#" + action + " MotionEvent With X: " + motion.getX() + " Y: " + motion.getY());
    }
    
    
}